<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/17
 * Time: 14:56
 */
// 1. 判断是否有id参数传入
if(empty($_GET["id"])){
    die("缺少id参数");
}
// 2. 如果有id参数，生成一个delete from student where id=传入的id语句
$id = $_GET["id"];
$sql = "delete from admin where id =$id";


include_once dirname(__FILE__) . "../../common/conn.php";

$res = mysqli_query($con,$sql);
mysqli_close($con);
// 4. 判断删除结果，并返回提示信息
if($res){
    echo "<script> {window.alert('删除成功');location.href='aList.php'} </script>";

    exit;
}
else{
    echo "<script> {window.alert('删除失败');location.href='aList.php'} </script>";

    exit;
}